﻿using FastEndpoints;
using vite_net.Common;
using vite_net.Controllers.User.UserInfo;

namespace vite_net.Controllers.User.GetMenus
{
    public class GetMenusEndpoint : ViteNetEndpoint<EmptyRequest, Result<Response_UserMenus>>
    {
        public override void Configure()
        {
            Get("/menus/byRoleId");
            Roles("ADMIN");
        }

        public override async Task HandleAsync(EmptyRequest req, CancellationToken ct)
        {

            var ss = GetCurrentUserId();
            var data = new Response_UserInfo()
            {
                UserId = 2,
                UserName = "admin",
                NickName = "系统管理员",
                Avatar = "https://oss.youlai.tech/youlai-boot/2023/05/16/811270ef31f548af9cffc026dfc3777b.gif",
                Roles = new[] { "ADMIN" },
                Perms = []
            };

            await SendAsync(Result<Response_UserMenus>.Ok(null));
        }
    }
}
